package com.gmall.search.service;

import com.gmall.common.result.Result;
import com.gmall.model.search.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.stereotype.Service;

@Service
public class GoodsService {


    @Autowired
    ElasticsearchRestTemplate elasticsearchRestTemplate;

    public Result<Goods> getGoodsById(Long skuId) {
        Goods goods = elasticsearchRestTemplate.get(skuId.toString(), Goods.class);
        return Result.ok(goods);
    }
}
